/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.mallsite.modules.shop.entity;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 商品相册Entity
 * @author ruyang
 * @version 2020-12-04
 */
@Table(name="ms_goods_images", alias="a", columns={
		@Column(name="images_id", attrName="imagesId", label="商品id", isPK=true),
		@Column(name="goods_id", attrName="goodsId", label="商品id"),
		@Column(name="src", attrName="src", label="src"),
		@Column(name="images_sort", attrName="imagesSort", label="排序"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class GoodsImages extends DataEntity<GoodsImages> {
	
	private static final long serialVersionUID = 1L;
	private String imagesId;		// 商品id
	private String goodsId;		// 商品id
	private String src;		// src
	private Integer imagesSort;		// 排序
	
	public GoodsImages() {
		this(null);
	}

	public GoodsImages(String id){
		super(id);
	}
	
	public String getImagesId() {
		return imagesId;
	}

	public void setImagesId(String imagesId) {
		this.imagesId = imagesId;
	}
	
	@NotBlank(message="商品id不能为空")
	@Length(min=0, max=128, message="商品id长度不能超过 128 个字符")
	public String getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(String goodsId) {
		this.goodsId = goodsId;
	}
	
	@NotBlank(message="src不能为空")
	@Length(min=0, max=512, message="src长度不能超过 512 个字符")
	public String getSrc() {
		return src;
	}

	public void setSrc(String src) {
		this.src = src;
	}
	
	@NotNull(message="排序不能为空")
	public Integer getImagesSort() {
		return imagesSort;
	}

	public void setImagesSort(Integer imagesSort) {
		this.imagesSort = imagesSort;
	}
	
}